<!DOCTYPE html>
<html lang="en-us">

<head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />

  	<meta property="og:title" content=" linux配置JDK、MySql、Tomcat &middot;  我的博客" />
  	<meta property="og:site_name" content="我的博客" />
  	<meta property="og:url" content="/my_technology/14/" />
    
    
  	<meta property="og:type" content="article" />

    <meta property="og:article:published_time" content="2020-06-16T19:59:48&#43;08:00" />

    
    

  <title>
     linux配置JDK、MySql、Tomcat &middot;  我的博客
  </title>

    <meta name="description" content="这里是付佳康的个人博客" />

    <meta name="HandheldFriendly" content="True" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />

    <link rel="shortcut icon" href="/my_technology/images/favicon.ico">
	  <link rel="apple-touch-icon" href="/my_technology/images/apple-touch-icon.png" />
    
    <link rel="stylesheet" type="text/css" href="/my_technology/css/screen.css" />
    <link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Merriweather:300,700,700italic,300italic|Open+Sans:700,400|Inconsolata" />


    
      
          <link href="/my_technology/index.xml" rel="alternate" type="application/rss+xml" title="我的博客" />
      
      
    
    <meta name="generator" content="Hugo 0.68.3" />

    <link rel="canonical" href="/my_technology/14/" />

     
</head>
<body class="nav-closed">
<div id="particles-js"></div>
  


 <div class="site-wrapper">



<header class="main-header " style="background-image: url(/my_technology/images/user.jpg)">

    <nav class="main-nav overlay clearfix">
        
            <a class="blog-logo" href="/my_technology/"><img src="/my_technology/images/user.png" alt="Blog Logo" /></a>
        
        
    </nav>
<div class="vertical">
        <div class="main-header-content inner">
            <h1 class="page-title">
              <a class="btn-bootstrap-2" href="#content">我的博客</a>
          </h1>
          <h2 class="page-description">这里是付佳康的个人博客</h2>
        </div>
</div>
    <a class="scroll-down icon-arrow-left" href="#content"><span class="hidden">Scroll Down</span></a>
</header>

  <main id="content" class="content" role="main">


  <article class="post ">

    <header class="post-header">
        <h1 class="post-title">linux配置JDK、MySql、Tomcat</h1>
        <section class="post-meta">
        
         
        </section>
    </header>

    <section class="post-content">
      <pre><code>Linux解压tar包的命令  
    tar -xvf  需要解压的报名 -x代表解压 v代表解压过程 f代表解压的文件
    tar -cvf 将哪些文件进行打包  打包成.tar压缩包
Linux安装wget软件包的命令 
    运行命令：yum -y install wget

Linux配置JDK：
    1.cd usr 在usr中创建jdk文件夹命令：mkdir jdk
    2.进入jdk文件夹命令：cd jdk
    3.下载jdk版本命令：wget下载  jdk下载地址：http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.rpm 
        wget --no-check-certificate --no-cookies --header &quot;Cookie: oraclelicense=accept-securebackup-cookie&quot; http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.rpm 
    4.下载之后可以使用ls命令查看，进行添加执行权限命令：chmod +x jdk-8u131-linux-x64.rpm (下载的jdk名)
    5.执行rpm进行安装，命令：rpm -ivh jdk-8u131-linux-x64.rpm (下载的jdk名)
    6.查看JDK是否安装成功，命令：java -version  
    7.查看JDK的安装路径（一般为/usr/java/jdk-8u131/）
    8.在etc下的profile中进行编辑，命令：vim profile
        添加：
            export JAVA_HOME=/usr/java/jdk1.8.0_131
            export JRE_HOME=${JAVA_HOME}/jre
            export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib:$CLASSPATH
            export JAVA_PATH=${JAVA_HOME}/bin:${JRE_HOME}/bin
            export PATH=$PATH:${JAVA_PATH}
        点击Esc 输入命令：wq保存退出
    9.加载并更新配置文件，命令：source profile
    10.使用 java -version   javac验证 若可用，表示配置成功
    
Linux配置MySql：
    1.cd usr 在usr中创建mysql文件夹，命令：mkdir mysql
    2.进入mysql文件夹，命令：cd mysql
    3.下载mysql版本命令：wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
    4.下载之后可以使用ls命令查看，进行添加执行权限命令：chmod +x mysql-community-release-el7-5.noarch.rpm
    5.执行rpm进行安装，命令：rpm -ivh mysql-community-release-el7-5.noarch.rpm 
    6.安装mysql服务端,命令：yum install mysql-community-server 也可下载到指定目录下：yum install mysql-community-server -y --downloaddir=/usr/local/src
    7.确保安装成功后重启mysql服务，命令：service mysqld restart
    8.进入mysql数据库，命令：mysql -u root，第一次登陆没有密码，如果想添加密码，继续执行mysql -u root -p密码
 
Linux配置Tomcat：
    1.cd usr 在usr中创建Tomcat文件夹，命令：mkdir tomcat
    2.进入tomcat文件夹，命令：cd tomcat
    3.下载tomcat的zip压缩包，命令：wget https://downloads.apache.org/tomcat/tomcat-9/v9.0.36/bin/apache-tomcat-9.0.36.zip
    4.下载之后可以使用ls命令查看，进行添加执行权限命令：chmod +x apache-tomcat-9.0.36.zip
    5.下载unzip，命令：yum install unzip
    6.再解压zip压缩包,生成apache-tomcat-9.0.36，命令: unzip apache-tomcat-9.0.36.zip
    7.使用递归的方式，将所有文件设上权限，命令：chmod a+x -R *
    8.cd apache-tomcat-9.0.36 确保都可以使用
    9.cd进入conf中，编辑server.xml可以根据需求编辑端口号，命令：vi server.xml  点击i进行更改
    10.返回进入bin目录,启动tomcat，Windows是startup.bat,Linux是startup.sh，命令：sh startup.sh
    11.关闭tomcat，Windows是shutdown.bat,Linux是shutdown.sh，命令：sh shutdown.sh
    12.bin目录下的webapps用来将测试的编译好的web项目放入，移动端项目不需要，再去启动tomcat时会自动找到相应项目
    
    
</code></pre>
    </section>


  <footer class="post-footer">


    
    <figure class="author-image">

        <a class="img" href="/my_technology/" style="background-image: url(/my_technology/images/user.png)"><span class="hidden">付佳康</span></a>
    </figure>
    

    <section class="author">

  <p>付佳康</p>
  

</section>


    
    <section class="share">
      <h4>Share this page</h4>
      <a class="icon-twitter" style="font-size: 1.4em" href="https://twitter.com/share?text=linux%e9%85%8d%e7%bd%aeJDK%e3%80%81MySql%e3%80%81Tomcat&amp;url=%2fmy_technology%2f14%2f"
          onclick="window.open(this.href, 'twitter-share', 'width=550,height=235');return false;">
          <span class="hidden">Twitter</span>
      </a>
      <a class="icon-facebook" style="font-size: 1.4em" href="https://www.facebook.com/sharer/sharer.php?u=%2fmy_technology%2f14%2f"
          onclick="window.open(this.href, 'facebook-share','width=580,height=296');return false;">
          <span class="hidden">Facebook</span>
      </a>
      <a class="icon-google-plus" style="font-size: 1.4em" href="https://plus.google.com/share?url=%2fmy_technology%2f14%2f"
         onclick="window.open(this.href, 'google-plus-share', 'width=490,height=530');return false;">
          <span class="hidden">Google+</span>
      </a>
    </section>
    

    
    
    

  </footer>
</article>

</main>
    <footer class="site-footer clearfix">
        <section class="copyright"><a href="">我的博客</a> </section>
        
        <section class="poweredby">Proudly generated by <a class="icon-hugo" href="https://gohugo.io">HUGO</a>, with <a class="icon-theme" href="https://github.com/syui/hugo-theme-air">hugo-theme-air</a> theme</section>
        
    </footer>
    </div>
    <script type="text/javascript" src="/my_technology/js/jquery.js"></script>
    <script type="text/javascript" src="/my_technology/js/jquery.fitvids.js"></script>
    <script type="text/javascript" src="/my_technology/js/index.js"></script>
    <script src="/my_technology/js/particles.min.js"></script>
    <script src="/my_technology/js/particles.js"></script>  

</body>
</html>

